Most modern optoelectronic and electro-optic devices are based on materials with local inhomogeneity in their chemical composition (e.g. semiconductor devices, optoelectronic wave mixers, waveguides). This is so, because the presence of chemical inhomogeneity is obligatory to get the required properties. Creation of the chemical inhomogeneity results in the creation of a gradient of chemical potential of atomic species. Therefore just after its creation the concentration gradient starts to relax through the diffusion of the inhomogeneously distributed species. As a result of this the device, made in this way, can be used only during a time much smaller than the relaxation time. The way to prolong the life time of the device is to slow down the diffusion of the species that gives rise to the chemical inhomogeneity. In this case the problem is how to put them in. Normally this is done at high temperatures. This kind of inhomogeneity is stable due to kinetic reasons.